# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=adwaita-icon-theme
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=44.0
pkgrel=1
pkgdesc="GNOME standard icons (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
url="https://gitlab.gnome.org/GNOME/adwaita-icon-theme"
license=("spdx:LGPL-3.0-or-later OR CC-BY-SA-3.0")
makedepends=(
  "${MINGW_PACKAGE_PREFIX}-gtk3"
  "${MINGW_PACKAGE_PREFIX}-autotools"
)
depends=(
  "${MINGW_PACKAGE_PREFIX}-hicolor-icon-theme"
  "${MINGW_PACKAGE_PREFIX}-librsvg"
  "${MINGW_PACKAGE_PREFIX}-gtk-update-icon-cache"
)
source=(
  "https://download.gnome.org/sources/${_realname}/${pkgver:0:2}/${_realname}-${pkgver}.tar.xz"
)
sha256sums=('4889c5601bbfecd25d80ba342209d0a936dcf691ee56bd6eca4cde361f1a664c')

prepare() {
  cd "${srcdir}/${_realname}-${pkgver}"
}

build() {
  mkdir "${srcdir}/build-${MINGW_CHOST}"
  cd "${srcdir}/build-${MINGW_CHOST}"

  ../"${_realname}-${pkgver}"/configure \
    --prefix="${MINGW_PREFIX}" \
    --build="${MINGW_CHOST}" \
    --host="${MINGW_CHOST}"

  make
}

package() {
  cd "${srcdir}/build-${MINGW_CHOST}"

  make DESTDIR="$pkgdir" install

  install -Dm644 "${srcdir}/${_realname}-${pkgver}"/COPYING "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING"
  install -Dm644 "${srcdir}/${_realname}-${pkgver}"/COPYING_LGPL "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING_LGPL"
  install -Dm644 "${srcdir}/${_realname}-${pkgver}"/COPYING_CCBYSA3 "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING_CCBYSA3"
}
